package cn.com.zetatech.loader.common.enums;

import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.stream.Collectors;

public enum FileMoveTypeEnums {

    MOVE("MOVE", "移动"),
    COPY("COPY", "复制"),
    ;

    private String key;

    private String value;

    public String value() {
        return this.value;
    }

    public String key() {
        return this.key;
    }

    FileMoveTypeEnums(String key, String value) {
        this.key= key;
        this.value = value;
    }

    public static String getByKey(String key) {
        try {
            return Arrays.asList((FileMoveTypeEnums.values())).stream().filter(item-> StringUtils.equals(item.key(), key))
                    .distinct().collect(Collectors.toList()).get(0).value;
        } catch(Exception e) {
            return "";
        }
    }

}
